/*    */ package com.cr.common.utils;
/*    */ 
/*    */ import java.util.HashMap;
/*    */ import java.util.Iterator;
/*    */ import java.util.Map;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ 
/*    */ public class MapDataUtil {
/*    */   public static Map<String, Object> convertDataMap(HttpServletRequest request) {
/* 18 */     Map<String, String[]> properties = request.getParameterMap();
/* 19 */     Map<String, Object> returnMap = new HashMap<>();
/* 20 */     Iterator<?> entries = properties.entrySet().iterator();
/* 22 */     String name = "";
/* 23 */     String value = "";
/* 24 */     while (entries.hasNext()) {
/* 26 */       Map.Entry<?, ?> entry = (Map.Entry<?, ?>)entries.next();
/* 27 */       name = (String)entry.getKey();
/* 28 */       Object valueObj = entry.getValue();
/* 29 */       if (null == valueObj) {
/* 31 */         value = "";
/* 33 */       } else if (valueObj instanceof String[]) {
/* 35 */         String[] values = (String[])valueObj;
/* 36 */         value = "";
/* 37 */         for (int i = 0; i < values.length; i++)
/* 39 */           value = value + values[i] + ","; 
/* 41 */         if (value.length() > 0)
/* 43 */           value = value.substring(0, value.length() - 1); 
/*    */       } else {
/* 48 */         value = valueObj.toString();
/*    */       } 
/* 50 */       returnMap.put(name, value);
/*    */     } 
/* 52 */     return returnMap;
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\lib\creditorRights-common-4.7.0.jar!\com\cr\commo\\utils\MapDataUtil.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */